<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>教务管理系统</title>
    <link rel="stylesheet" href="layui/css/layui.css" th:href="@{/web/layui/css/layui.css}">
    <link rel="stylesheet" href="css/admin.css" th:href="@{/web/css/admin.css}">
    <link rel="stylesheet" href="css/l-style.css" th:href="@{/web/css/l-style.css}"/>
    <link rel="stylesheet" href="css/l-style_8.css" th:href="@{/web/css/l-style_8.css}"/>
    <script type="text/javascript" src="js/echarts.js" th:src="@{/web/js/echarts.js}"></script>
</head>
<body style="min-width: 1034px;">
<div class="layui-layout layui-layout-admin" id="box">
    <div class="layui-header dang_head" id="app-header">
        <ul class="layui-nav layui-layout-left" lay-filter="nepadmin-header">
            <li class="layui-nav-item" lay-unselect>
                <a nepadmin-event="flexible" class="menu_sil">
                    <span class="title">教务管理系统</span>
                </a>
            </li>
        </ul>
        <ul class="layui-nav layui-layout-right dang_la_out" lay-filter="nepadmin-header">
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a class="label">
                    <input type="text" class="input-s" placeholder="请输入关键字"/>
                    <button class="but_s"></button>
                </a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a href="#" nepadmin-event="fullscreen">
                    <i class="layui-icon user"></i>
                    <span class="text">管理员</span>
                </a>
            </li>
            <li class="layui-nav-item layui-hide-xs" lay-unselect>
                <a>
                    <i class="layui-icon mess"><b class="mess_num">8</b></i>
                </a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a href="#" nepadmin-event="message" title="消息提醒">
                    <i class="layui-icon shezhi"></i>
                </a>
            </li>
            <li class="layui-nav-item" lay-unselect>
                <a class="layui-hide-xs" href="login.html">
                    <i class="layui-icon exit"></i>
                </a>
            </li>
        </ul>
    </div>
    <div class="nepadmin-tabs-hidden layui-show">
        <div class="nepadmin-tabs-wrap dang_tabs" is-template="true">
            <span class="nepadmin-tabs-btn nepadmin-tabs-action nepadmin-tabs-a" data-type="prev"> <a
                    nepadmin-event="flexible" class="menu_sil"> <i class="layui-icon menu"></i> </a> </span>
            <span class="nepadmin-tabs-btn nepadmin-tabs-action nepadmin-tabs-prev" id="nepadmin-tabs-prev"
                  data-type="prev"> <i class="layui-icon left"></i> </span>
            <span class="nepadmin-tabs-btn nepadmin-tabs-action nepadmin-tabs-next" id="nepadmin-tabs-next"
                  data-type="next"> <i class="layui-icon right"></i> </span>
            <!--<span class="nepadmin-tabs-btn nepadmin-tabs-action nepadmin-tabs-down" data-type="down"> <i class="layui-icon layui-icon-close"></i> </span>-->
            <ul class="nepadmin-tabs-menu" style="left: 250px;">
                <li data-type="page" class="nepadmin-tabs-btn nepadmin-tabs-active">
                    <a href="index0.html" target="frame"><i class="bot"></i>首页<b
                            class="layui-icon nepadmin-tabs-close close"></b></a>
                </li>
            </ul>
        </div>
    </div>
    <!-- 侧边菜单 -->
    <div class="layui-side dang_side" id="app-sidebar">
        <div class="layui-side-scroll">
            <div class="layui-logo">
                <img src="images/logo.png" th:src="@{/web/images/logo.png}" style="width:200px;height: 85px;"/>
            </div>
            <ul class="layui-nav layui-nav-tree dang_nav" lay-filter="jw-nav" is-template="true" id="nav-ui">
                <li class="layui-nav-item">
                    <a target="frame" href="index0.html" title="首页"><i class="layui-icon menu_a1"></i>首页</a>
                </li>
                <li class="layui-nav-item">
                    <a target="" title=""><i class="layui-icon menu_a4"></i>表单<span class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child">
                        <dd>
                            <a style="padding-left:50px" target="frame" href="group.html" title="表单1">表单1</a>
                        </dd>
                        <dd>
                            <a style="padding-left:50px" target="frame" href="group1.html" title="表单2">表单2</a>
                        </dd>
                    </dl>
                </li>
                <span class="layui-nav-bar" style="top: 224px; height: 0px; opacity: 0;"></span>
            </ul>
        </div>
    </div>
    <a nepadmin-event="flexible" title="侧边伸缩" class="left_but menu_sil">
        <i class="layui-icon i_l"></i>
    </a>
    <!-- 主体内容 -->
    <div class="layui-body dang_body nepadmin-tabs-body" id="app-body">
        <iframe src="index0.html" th:src="@{/main}" id="mainframe" frameborder="no" name="frame" scrolling='yes'
                style="width: 100%; box-sizing: border-box;  border: none;  background: #fff; min-height: 99.2%;"></iframe>
    </div>
</div>

<script src="js/jquery.min.js" th:src="@{/web/js/jquery.min.js}"></script>
<!--<script src="js/jquery-2.1.4.min.js" th:src="@{/web/js/jquery-2.1.4.min.js}"></script>-->
<!--<script src="layui/layui.js" th:src="@{/web/layui/layui.js}"></script>-->
<script src="layui/layui.all.js" th:src="@{/web/layui/layui.all.js}"></script>
<script th:inline="javascript">
    let ctx = "http://localhost:8080";
    let promise = new Promise((resolve, rejected) => {
        layui.use('element', function () {
            let element = layui.element;
            function Submenu(item, li) {
                li += "<dl class=\"layui-nav-child\">";
                for (let i = 0; i < item.length; i++) {
                    if (item[i].list.length != 0) {
                        li += "<a target=\"\" title=\"\"><i class=\"layui-icon menu_a4\"></i>" + item[i].authFunction.name + "<span class=\"layui-nav-more\"></span></a>";
                        Submenu(item[i].list, li);
                    } else {
                        li += "<dd><a style=\"padding-left:50px\" target=\"frame\" href="+item[i].authFunction.page+" title="+item[i].authFunction.name+">" + item[i].authFunction.name + "</a></dd>";
                    }
                }
                li += "</li>";
                $("#nav-ui").append(li)
                resolve(element)
            }

            $.ajax({
                type: "get",
                url: ctx + "/function/menu",
                dataType: "json",
                success(data) {
                    $.each(data, function (index, item) {
                        if (item.list.length != 0) {
                            let li = '<li class="layui-nav-item">';
                            li += " <a target=\"\" title=\"\"><i class=\"layui-icon menu_a4\"></i>" + item.authFunction.name + "<span class=\"layui-nav-more\"></span></a>";
                            Submenu(item.list, li);
                        } else {
                            let li = '<li class="layui-nav-item">';
                            li += " <a target=\"frame\" title=\"\" href=" + ctx + "><i class=\"layui-icon menu_a4\"></i>" + item.authFunction.name + "<span class=\"layui-nav-more\"></span></a></li>";
                            $("#nav-ui").append(li)
                        }
                    });
                },
                error(data) {
                    layer.alert("菜单加载失败")
                }
            });
        })
    })
    promise.then(resolve => {
        resolve.render('nav','jw-nav');
    })
</script>
<script type="text/javascript" src="js/view.js" th:src="@{/web/js/view.js}"></script>
<script>

    $("#mainframe").load(function () {
        var if_h = $("#mainframe").contents().find('.dang_fluid').height() + 20;
        //alert("if_w==" + if_w + "\n" + "if_h==" + if_h);
        $("#mainframe").height(if_h);
        aa();
    })


</script>
<script type="text/javascript" src="js/l-index.js" th:src="@{/web/js/l-index.js}"></script>
</body>
<!--<script src="js/ie8hack/html5shiv.min.js" th:src="@{/web/js/ie8hack/html5shiv.min.js}"></script>-->
<!--<script src="js/ie8hack/respond.min.js" th:src="@{/web/js/ie8hack/respond.min.js}"></script>-->
<!--<script src="js/ie8hack/placeholders.min.js" th:src="@{/web/js/ie8hack/placeholders.min.js}"></script>-->
</html>